home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWPrHdlr.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.7 KB  |  122 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPrHdlr.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPRHDLR_H
  11. #define FWPRHDLR_H
  12.  
  13. #ifndef FWEVENTH_H
  14. #include "FWEventH.h"
  15. #endif
  16.  
  17. //========================================================================================
  18. //    Forward Declarations
  19. //========================================================================================
  20.  
  21. struct Environment;
  22.  
  23. class FW_CPrintInfo;
  24. class FW_CPrintEnvironment;
  25. class FW_CFrame;
  26. class FW_CRect;
  27. class FW_CView;
  28. class FW_CPart;
  29. class FW_CString;
  30. class FW_CPoint;
  31.  
  32. //========================================================================================
  33. //    class FW_CPrintHandler
  34. //========================================================================================
  35.  
  36. class FW_CPrintHandler : public FW_MEventHandler
  37. {
  38. //----------------------------------------------------------------------------------------
  39. //    Constructors/Destructor
  40. //
  41. public:
  42.     FW_CPrintHandler(FW_CPart* part, FW_CFrame* frame, FW_Boolean updateEmbeddedFacets = TRUE);
  43.     virtual    ~FW_CPrintHandler();
  44.  
  45. //----------------------------------------------------------------------------------------
  46. //    Inherited API
  47. //
  48. public:
  49.     virtual FW_Handled            DoAdjustMenus(Environment *ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  50.     virtual FW_Handled            DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    New API
  54. //
  55. // ----- Overridables - printing
  56. protected:
  57.     virtual    FW_Boolean            IsCurrentlyPrintable(Environment* ev) const;
  58.     virtual void                GetPrintContentExtent(Environment* ev, FW_CPoint& extent) const;
  59.     virtual void                PrintPage(Environment* ev, ODFacet* facet, const FW_CRect& pageBounds, long xPage, long yPage);
  60.  
  61. // ----- Overridables - dialogs
  62. public:
  63.     virtual void                CreateProgressDialog(
  64.                                     Environment*        ev,
  65.                                     ODFrame*            frame,
  66.                                     long                numPages,
  67.                                     const FW_CString&    title);
  68.  
  69.     virtual void                DestroyProgressDialog(
  70.                                     Environment*        ev,
  71.                                     ODFrame*            frame);
  72.  
  73.     virtual void                UpdateProgressDialog(
  74.                                     long                pageNumber);
  75. protected:
  76.  
  77.     virtual FW_Boolean            DoPageSetupDialog(Environment* ev);
  78.     virtual FW_Boolean            DoJobDialog(Environment* ev);
  79.     virtual void                NotifyNoDefaultPrinter(Environment* ev);
  80.     virtual void                NotifyPrintingCanceled(Environment* ev);
  81.  
  82.  
  83. public:    
  84. // ----- Operations
  85.     void                        HandlePageSetup(Environment* ev);
  86.     void                        HandlePrint(Environment* ev);
  87.                                     
  88. // ----- Attributes
  89.     FW_CPart*                    GetPart() const;
  90.     FW_CFrame*                    GetFrame() const;
  91.     FW_CView*                    GetPrintView() const;
  92.                                 
  93.     FW_CPrintInfo*                GetPrintInfo() const;                            
  94.  
  95. // ----- Overridables - printing
  96. protected:
  97.     virtual void                GetPrintJobTitle(Environment* ev, FW_CString& jobTitle) const;
  98.  
  99.     virtual FW_CView*            CreatePrintView(Environment* ev);
  100.     virtual void                ReleasePrintView(Environment* ev);
  101.  
  102.     virtual    void                PrintDocument(Environment* ev, FW_CPrintEnvironment* printEnv);
  103.     virtual void                CountPrintPages(Environment* ev, long& xPageCount, long& yPageCount);
  104.  
  105. // ----- Helpers
  106.     FW_Boolean                    PreModalDialog(Environment* ev);                                    
  107.     void                        PostModalDialog(Environment* ev);
  108.  
  109. //----------------------------------------------------------------------------------------
  110. //    Data Members
  111. //
  112. private:
  113.     FW_CPart*                    fPart;
  114.     FW_CFrame*                    fFrame;
  115.     FW_CView*                    fPrintView;
  116.     FW_Boolean                    fUpdateEmbeddedFacets;    // TRUE if the print handler needs to draw embedded facets
  117.                                                         // FALSE if the part draws the embedded facets
  118. };
  119.  
  120. #endif
  121.  
  122.